import service from '@/utils/request'
// @Tags Seckill_activity_device
// @Summary 创建秒杀活动设备
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Seckill_activity_device true "创建秒杀活动设备"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /seckill_activity_device/createSeckill_activity_device [post]
export const createSeckill_activity_device = (data) => {
  return service({
    url: '/seckill_activity_device/createSeckill_activity_device',
    method: 'post',
    data
  })
}

// @Tags Seckill_activity_device
// @Summary 删除秒杀活动设备
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Seckill_activity_device true "删除秒杀活动设备"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /seckill_activity_device/deleteSeckill_activity_device [delete]
export const deleteSeckill_activity_device = (params) => {
  return service({
    url: '/seckill_activity_device/deleteSeckill_activity_device',
    method: 'delete',
    params
  })
}

// @Tags Seckill_activity_device
// @Summary 批量删除秒杀活动设备
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除秒杀活动设备"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /seckill_activity_device/deleteSeckill_activity_device [delete]
export const deleteSeckill_activity_deviceByIds = (params) => {
  return service({
    url: '/seckill_activity_device/deleteSeckill_activity_deviceByIds',
    method: 'delete',
    params
  })
}

// @Tags Seckill_activity_device
// @Summary 更新秒杀活动设备
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data body model.Seckill_activity_device true "更新秒杀活动设备"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /seckill_activity_device/updateSeckill_activity_device [put]
export const updateSeckill_activity_device = (data) => {
  return service({
    url: '/seckill_activity_device/updateSeckill_activity_device',
    method: 'put',
    data
  })
}

// @Tags Seckill_activity_device
// @Summary 用id查询秒杀活动设备
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data query model.Seckill_activity_device true "用id查询秒杀活动设备"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /seckill_activity_device/findSeckill_activity_device [get]
export const findSeckill_activity_device = (params) => {
  return service({
    url: '/seckill_activity_device/findSeckill_activity_device',
    method: 'get',
    params
  })
}

// @Tags Seckill_activity_device
// @Summary 分页获取秒杀活动设备列表
// @Security ApiKeyAuth
// @Accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取秒杀活动设备列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /seckill_activity_device/getSeckill_activity_deviceList [get]
export const getSeckill_activity_deviceList = (params) => {
  return service({
    url: '/seckill_activity_device/getSeckill_activity_deviceList',
    method: 'get',
    params
  })
}

// @Tags Seckill_activity_device
// @Summary 不需要鉴权的秒杀活动设备接口
// @Accept application/json
// @Produce application/json
// @Param data query systemReq.Seckill_activity_deviceSearch true "分页获取秒杀活动设备列表"
// @Success 200 {object} response.Response{data=object,msg=string} "获取成功"
// @Router /seckill_activity_device/getSeckill_activity_devicePublic [get]
export const getSeckill_activity_devicePublic = () => {
  return service({
    url: '/seckill_activity_device/getSeckill_activity_devicePublic',
    method: 'get',
  })
}
// UpdateStockSaga 发起Saga，前端编辑库存时用
// @Tags Seckill_activity_device
// @Summary 发起Saga，前端编辑库存时用
// @Accept application/json
// @Produce application/json
// @Param data body object true "库存变更数据"
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/updateStockSaga [POST]
export const updateStockSaga = (data) => {
  return service({
    url: '/seckill_activity_device/updateStockSaga',
    method: 'POST',
    data
  })
}
// DecreaseStock Saga步骤1，扣减真实库存
// @Tags Seckill_activity_device
// @Summary Saga步骤1，扣减真实库存
// @Accept application/json
// @Produce application/json
// @Param data body object true "扣减库存请求"
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/decreaseStock [POST]
export const decreaseStock = (data) => {
  return service({
    url: '/seckill_activity_device/decreaseStock',
    method: 'POST',
    data
  })
}
// DecreaseStockCompensate Saga步骤1补偿
// @Tags Seckill_activity_device
// @Summary Saga步骤1补偿
// @Accept application/json
// @Produce application/json
// @Param data body object true "补偿请求"
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/decreaseStockCompensate [POST]
export const decreaseStockCompensate = (data) => {
  return service({
    url: '/seckill_activity_device/decreaseStockCompensate',
    method: 'POST',
    data
  })
}
// UpdateStock Saga步骤2，更新活动库存
// @Tags Seckill_activity_device
// @Summary Saga步骤2，更新活动库存
// @Accept application/json
// @Produce application/json
// @Param data body object true "更新库存请求"
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/updateStock [POST]
export const updateStock = (data) => {
  return service({
    url: '/seckill_activity_device/updateStock',
    method: 'POST',
    data
  })
}
// UpdateStockCompensate Saga步骤2补偿
// @Tags Seckill_activity_device
// @Summary Saga步骤2补偿
// @Accept application/json
// @Produce application/json
// @Param data body object true "补偿请求"
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/updateStockCompensate [POST]
export const updateStockCompensate = (data) => {
  return service({
    url: '/seckill_activity_device/updateStockCompensate',
    method: 'POST',
    data
  })
}
// PreheatStock 前端"预热"按钮用
// @Tags Seckill_activity_device
// @Summary 前端"预热"按钮用
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/preheatStock [POST]
export const preheatStock = (data) => {
  return service({
    url: '/seckill_activity_device/preheatStock',
    method: 'POST',
    data
  })
}
// ClearRedis 补偿或手动清空Redis
// @Tags Seckill_activity_device
// @Summary 补偿或手动清空Redis
// @Accept application/json
// @Produce application/json
// @Param data body object true "清空Redis请求"
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/clearRedis [POST]
export const clearRedis = (data) => {
  return service({
    url: '/seckill_activity_device/clearRedis',
    method: 'POST',
    data
  })
}

// CacheAllToRedis 缓存列表
// @Tags Seckill_activity_device
// @Summary 缓存列表
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/cacheAllToRedis [POST]
export const cacheAllToRedis = () => {
  return service({
    url: '/seckill_activity_device/cacheAllToRedis',
    method: 'POST'
  })
}
// GetAllFromRedis 获取缓存列表数据
// @Tags Seckill_activity_device
// @Summary 获取缓存列表数据
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/getAllFromRedis [GET]
export const getAllFromRedis = () => {
  return service({
    url: '/seckill_activity_device/getAllFromRedis',
    method: 'GET'
  })
}
// SeckillCreateOrder 生成订单
// @Tags Seckill_activity_device
// @Summary 生成订单
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=object,msg=string} "成功"
// @Router /seckill_activity_device/seckillCreateOrder [POST]
export const seckillCreateOrder = (data) => {
  return service({
    url: '/seckill_activity_device/seckillCreateOrder',
    method: 'POST',
    data
  })
}
